<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
	<title>Dynatree - Example</title>

	<script src="../jquery/jquery.js" type="text/javascript"></script>
	<script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script>
	<script src="../jquery/jquery.cookie.js" type="text/javascript"></script>

	<link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet">
	<script src="../src/jquery.dynatree.js" type="text/javascript"></script>

	<!-- Start_Exclude: This block is not part of the sample code -->
	<link href="prettify.css" rel="stylesheet">
	<script src="prettify.js" type="text/javascript"></script>
	<link href="sample.css" rel="stylesheet" type="text/css">
	<script src="sample.js" type="text/javascript"></script>
	<!-- End_Exclude -->
	<style type="text/css">
		.dynatree-container.dynatree-rtl .dynatree-title {
			unicode-bidi: bidi-override; /* optional: reverse title letters */
		}
		ul.dynatree-container.dynatree-rtl ul {
			padding: 0 16px 0 0;
		}
		ul.dynatree-container.dynatree-rtl li {
			background-position: right 0;
			background-image: url("../src/skin/vline-rtl.gif");
		}
		.dynatree-container.dynatree-rtl span.dynatree-connector,
		.dynatree-container.dynatree-rtl span.dynatree-expander,
		.dynatree-container.dynatree-rtl span.dynatree-icon,
		.dynatree-container.dynatree-rtl span.dynatree-drag-helper-img,
		.dynatree-container.dynatree-rtl #dynatree-drop-marker {
			background-image: url("../src/skin/icons-rtl.gif");
		}
	</style>
	<script type="text/javascript">
		$(function(){
			$("#tree").dynatree({
				dnd: {
					onDragStart: function(node) {
						return true;
					},
					onDragEnter: function(node, sourceNode) {
						return true;
					},
					onDrop: function(node, sourceNode, hitMode, ui, draggable) {
						sourceNode.move(node, hitMode);
					}
				},
				onPostInit: function(){
					// Set RTL attribute on init
					this.$tree.find("ul.dynatree-container").attr("DIR", "RTL").addClass("dynatree-rtl");
				}
			});
			<!-- Start_Exclude: This block is not part of the sample code -->
			$("#skinCombo")
			.val(0) // set state to prevent caching
			.change(function(){
				var href = "../src/"
					+ $(this).val()
					+ "/ui.dynatree.css"
					+ "?reload=" + new Date().getTime();
				$("#skinSheet").attr("href", href);
			});
			<!-- End_Exclude -->
		});
	</script>
</head>

<body class="example">
	<h1>Example: RTL</h1>
	<p class="description">
		This tree uses some extra styles to provide RTL support (experimental).
	</p>
	<div>
		Skin:
		<select id="skinCombo" size="1">
			<option value="skin">Standard ('/skin/')</option>
			<option value="skin-vista">Vista ('/skin-vista/')</option>
		</select>
	</div>

	<div id="tree">
		<ul id="treeData" style="display: none;">
			<li id="id1" title="Look, a tool tip!">item1 with key and tooltip
			<li id="id2">item2
			<li id="id3" class="folder">Folder with some children
				<ul>
					<li id="id3.1">Sub-item 3.1
						<ul>
							<li id="id3.1.1">Sub-item 3.1.1
							<li id="id3.1.2">Sub-item 3.1.2
						</ul>
					<li id="id3.2">Sub-item 3.2
						<ul>
							<li id="id3.2.1">Sub-item 3.2.1
							<li id="id3.2.2">Sub-item 3.2.2
						</ul>
				</ul>
			<li id="id4" class="expanded">Document with some children (expanded on init)
				<ul>
					<li id="id4.1"  class="active focused">Sub-item 4.1 (active and focus on init)
						<ul>
							<li id="id4.1.1">Sub-item 4.1.1
							<li id="id4.1.2">Sub-item 4.1.2
						</ul>
					<li id="id4.2">Sub-item 4.2
						<ul>
							<li id="id4.2.1">Sub-item 4.2.1
							<li id="id4.2.2">Sub-item 4.2.2
						</ul>
				</ul>
		</ul>
	</div>

	<!-- Start_Exclude: This block is not part of the sample code -->
	<hr>
	<p class="sample-links  no_code">
		<a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a>
		<a class="hideOutsideFS" href="#">Link to this page</a>
		<a class="hideInsideFS" href="samples.html">Example Browser</a>
		<a href="#" id="codeExample">View source code</a>
	</p>
	<pre id="sourceCode" class="prettyprint" style="display:none"></pre>
	<!-- End_Exclude -->
</body>
</html>
